﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="List.aspx.vb" Inherits="Prototype_Assignments_2.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView2" runat="server" AllowSorting="True" 
    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" 
    DataSourceID="MercedesDb" ForeColor="#333333" GridLines="None">
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <Columns>
        
       
        <asp:TemplateField HeaderText="Picture">
         
            <ItemTemplate>
           <asp:HyperLink ID="Hyperlink1" NavigateUrl ='<%# Eval("ID", "Detail.aspx?ID={0}") %>' runat ="server">
           <asp:Image ID="Image1" runat = "server" ImageUrl ='<%# Eval("Picture") %>' CssClass ="imageSize" /> 

           </asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>

        <asp:BoundField DataField="ModelName" HeaderText="Model Name" 
            SortExpression="ModelName" />
        <asp:BoundField DataField="ModelYear" HeaderText="Model Year" 
            SortExpression="ModelYear" />
        <asp:BoundField DataField="Price" HeaderText="Price £" SortExpression="Price" />
        <asp:HyperLinkField DataNavigateUrlFields="ID" 
            DataNavigateUrlFormatString="Detail.aspx?ID={0}" HeaderText="More Detail" 
            Text="More Detail" />
        
       
    </Columns>
    <EditRowStyle BackColor="#999999" />
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#E9E7E2" />
    <SortedAscendingHeaderStyle BackColor="#506C8C" />
    <SortedDescendingCellStyle BackColor="#FFFDF8" />
    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
<asp:SqlDataSource ID="MercedesDb" runat="server" 
    ConnectionString="<%$ ConnectionStrings:MercedesConn %>" 
    ProviderName="<%$ ConnectionStrings:MercedesConn.ProviderName %>" 
    SelectCommand="SELECT * FROM [Mercedes]"></asp:SqlDataSource>
</asp:Content>
